package com.my.financial.controller.form;

public class PageInfo {
	// 共有多少行记录
	private Integer totalRows;
	// 第几页
	private Integer pageNum;
	// 共有多少页
	private Integer totalPages;
	// 每页多少行
	private final Integer rowPerPage = 20;

	public PageInfo() {}

	public PageInfo(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public Integer getTotalRows() {
		return totalRows;
	}
	
	public void setTotalRows(Integer totalRows) {
		this.totalRows = totalRows;
		if(totalRows%this.rowPerPage==0){
			this.totalPages = totalRows / this.rowPerPage;
		}else{
			this.totalPages = totalRows / this.rowPerPage + 1;
		}
	}

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public Integer getCountPerPage() {
		return rowPerPage;
	}

	public Integer getTotalPages() {
		return totalPages;
	}

}
